Skip to content

Make geometric line equality invariant to Plucker sign - #307

Open
kaushikgunasekaren wants to merge 2 commits into
rai-opensource:masterfrom
kaushikgunasekaren:fix-line3-equality-sign-nov16
Open

kaushikgunasekaren wants to merge 2 commits into
rai-opensource:masterfrom
kaushikgunasekaren:fix-line3-equality-sign-nov16

Conversation

@kaushikgunasekaren

Copy link
Copy Markdown

Bug

Line3.isequal() and the ==/!= operators reject equivalent lines when their homogeneous Plucker vectors have opposite signs. In particular, swapping the endpoints in Line3.Join(p, q) makes the same geometric line compare unequal.

Fix

Compare the magnitude of the normalized dot product with one. This preserves the existing tolerance and positive-scale behavior while accepting negative homogeneous scales.

Validation

  • 37 regression/control cases cover three lines, signed scales from 1e-10 to 1e10, operand reversal, reversed endpoints, all three equality entry points, and distinct parallel/intersecting/skew lines.
  • Before: 13 failed, 24 passed. After: all 37 pass.
  • Full local suite on Python 3.12: 603 passed, 3 skipped, 99 subtests passed; 21 existing warnings. Pristine master25b19b3: 566 passed with the same skips/subtests/warnings.
  • Black23.10.0, fatal-error flake8 checks and git diff --check on the change pass.

This changes geometric equality only, not line containment (#298), line relations (#232), unique intersections (#273) or parallel closest points (#304). AI assistance was used for investigation, implementation and tests. Validated locally without robot hardware.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant